<template>
  <div class="updata_line beautifulScroll">
    <!-- 更新记录 -->
    <div v-if="resourceRecords.length == 0" class="zygxjl">
      暂无更新记录
    </div>
    <el-timeline class="dfcs">
      <el-timeline-item
        :timestamp="item.createTime"
        placement="top"
        v-for="item in resourceRecords"
        :key="item.id"
        size="large"
        icon="el-icon-edit-outline"
      >
        <!-- <div class="gxjlr" v-if="item.context != ''">
          {{ item.context }}
        </div> -->
        <div v-html="item.context"></div>
        <div class="gxjlr" v-if="!item.context">
          暂无更新描述
        </div>
      </el-timeline-item>
    </el-timeline>
  </div>
</template>

<script>
import { getUpdateRecord } from '@/api/simulation.js'
export default {
  props: {
    resourceId: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      resourceRecords: []
    }
  },
  created() {
    this.getResourceUpdate()
  },
  methods: {
    getResourceUpdate() {
      getUpdateRecord({
        resourceId: this.resourceId,
        limit: 1000
      }).then(res => {
        this.resourceRecords = res.data.records
        console.log(res.data.records)
      })
    }
  }
}
</script>
<style>
.gxjlr {
  font-size: 16px !important;
  color: #525879;
}
.dfcs .el-timeline-item__node--large {
  height: 36px;
  width: 36px;
  background-color: #fff;
  border: 1px solid #aeb2c3;
  position: absolute;
  top: 0px;
  left: -13.5px;
}
.dfcs .el-timeline-item__icon {
  color: #aeb2c3;
  font-size: 20px;
}
.dfcs .el-timeline-item__wrapper {
  padding-left: 40px;
}
</style>
